﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZiDingYiKj
{
    public partial class UserButton : UserControl
    {
        public UserButton()
        {
            InitializeComponent();
        }
        public event EventHandler OnChange;
        private void button1_Click(object sender, EventArgs e)
        {
            Console.WriteLine("出发button的点击事件");
           
            base.OnClick(null);
            
        }

        private void Change()
        {
            OnChange(this, null);
        }

        private void UserButton_Load(object sender, EventArgs e)
        {
            Click += button1_Click;
            //Click(null, null);
        }

        private void UserButton_Click(object sender, EventArgs e)
        {
            Control c = this;
                 
            while (c.Parent==null)
            {
                 c = c.Parent;
            }
        }
        private class EventList
        {
            internal EventList next;
            internal object key;
            internal Delegate handler;
            public EventList(EventList next,object key,Delegate handler)
            {
                this.key = key;
                this.next = next;
                this.handler = handler;
            }
        }
        EventList head;
        private EventList GetTagObj(object key)
        {
            EventList next = head;
            while(next !=null && next.key != key)
            {
                next = next.next;
            }
            return next;
        }
    }
    
}
